package com.woniuxy.yogaapp.service.imp;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.woniuxy.yogaapp.mapper.UserRolesMapper;
import com.woniuxy.yogaapp.pojo.UserRoles;
import com.woniuxy.yogaapp.service.UserRolesService;

import lombok.Data;

@Data
@Service
public class UserRolesServiceImp implements UserRolesService {
	@Resource
	private UserRolesMapper userRolesMapper;

	/**
	 * 添加学员权限
	 */
	@Override
	public String addStudentRoles(UserRoles userRoles) {
		String result = "添加失败！";
		int row = userRolesMapper.deleteRoles(userRoles);
		int row1 = userRolesMapper.addStudentRoles(userRoles);
		if (row > 0 && row1 > 0) {
			result = "添加成功！";
		}
		return result;
	}

}
